package com.aditya.personalexpense;

import java.util.Vector;

import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.aditya.personalexpense.adapters.CategoryAdapter;
import com.aditya.personalexpense.adapters.CurrencyAdapter;
import com.aditya.personalexpense.adapters.PayModeAdapter;
import com.aditya.personalexpense.controls.ColorPickerDialog;
import com.aditya.personalexpense.controls.ColorPickerDialog.OnColorSelectedListener;
import com.aditya.personalexpense.controls.ExpandableHieightListView;
import com.aditya.personalexpense.dataaccess.CategoryDA;
import com.aditya.personalexpense.dataaccess.CurrencyDA;
import com.aditya.personalexpense.dataaccess.PayModeDA;
import com.aditya.personalexpense.dataobject.CategoryDO;
import com.aditya.personalexpense.dataobject.CurrencyDO;
import com.aditya.personalexpense.dataobject.PayModeDO;

public class SettingsActivity extends FragmentActivity implements OnClickListener
{
	TextView tvCurrency, tvBackUpRestore, tvSpreadSheet, tvCategories, tvPayMode;
	
	CurrencyAdapter currencyAdapter;
	CategoryAdapter categoryAdapter;
	PayModeAdapter payModeAdapter;
	
	
	Vector<CategoryDO> vecCategoryDO;
	Vector<PayModeDO> vecPayModeDO;
	Vector<CurrencyDO> vecCurrencyDO;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings_activity);
		initializeControls();
	}
		
		
	private void initializeControls() 
	{
		tvCurrency = (TextView) findViewById(R.id.tvCurrency); 
		tvBackUpRestore = (TextView) findViewById(R.id.tvBackupRestore); 
		tvSpreadSheet = (TextView) findViewById(R.id.tvSpreadsheet);
		tvCategories = (TextView) findViewById(R.id.tvCategories); 
		tvPayMode = (TextView) findViewById(R.id.tvPayMode);
		
		
		
		tvCurrency.setOnClickListener(this);
		tvBackUpRestore.setOnClickListener(this);
		tvSpreadSheet.setOnClickListener(this);
		tvCategories.setOnClickListener(this);
		tvPayMode.setOnClickListener(this);
		
	}
	
	
	@Override
	public void onClick(View v) 
	{
		
		final AlertDialog.Builder alertDialog;
		LinearLayout view;
		Button btnOk;
		Button btnCancel;
		final AlertDialog dialog;
		final TextView tvtitle;
		Intent intent;
		
		switch (v.getId()) 
		{
		case R.id.tvCurrency:
			intent = new Intent(SettingsActivity.this, CurrencyActivity.class);
			startActivity(intent);
		break;
		case R.id.tvCategories:
			intent = new Intent(SettingsActivity.this, CategoriesActivity.class);
			startActivity(intent);
		break;
		case R.id.tvPayMode:
			intent = new Intent(SettingsActivity.this, PayModeActivity.class);
			startActivity(intent);
		break;
		default:
			break;
		}
		
	}

}
